(function(){
	Ext.define('AppView.base.FormWin',{
		extend:'Ext.window.Window',
		alias:'widget.formwin',
		layout:'fit',
		requires:['AppView.base.BaseForm'],
		title:'FormWin',
		height:400,
		width:400,
		items:[
			{
				xtype:'baseform'
			}
		],
		buttons: [{
	        text: '提交',
	        formBind: true, //only enabled once the form is valid
	        handler: function() {
	            var form = this.up('window').down('form').getForm();
	            if (form.isValid()) {
	                form.submit({
	                    success: function(form, action) {
	                       Ext.Msg.alert('Success', action.result.msg);
	                    },
	                    failure: function(form, action) {
	                        Ext.Msg.alert('Failed', action.result.msg);
	                    }
	                });
	            }
	        }
	    },{
	        text: '重置',
	        handler: function() {
	            this.up('window').down('form').getForm().reset();
	        }
	    }]
	})
})()